package com.cloud.manage.jobHandler.leida;

import com.cloud.manage.utils.ClzJobUnit;
import com.cloud.manage.utils.JobParame;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

//实况
@Component
//使用默认数据源可以不进行配置
public class GetLeiDaParentJob {
    @XxlJob(value = "xxx")
    public void getXXX() throws Exception {

        //为防止出现任务重叠运行导致名称重复的情况，单独新建对象
        ClzJobUnit jobUnit = new ClzJobUnit();
        //为该定时任务初始化任务参数
        JobParame jobParame = new JobParame();
        try {
            jobUnit.jobName = "xxx";
            jobUnit.jobInit();
            System.out.println("111");
            if (!jobParame.getNormalEndFlag()) {
                jobUnit.jobError(jobParame.getErrorMsg());
                return;
            }
            jobUnit.jobDestroy();
        } catch (Exception e) {
            jobUnit.jobErrorInfo(e);
        } finally {
            jobUnit.jobInitString();
        }
    }
}
